# -*- mode: python -*-

Import("env")

env = env.Clone()

env.CppUnitTest(
    target="util_concurrency_test",
    source=[],
    LIBDEPS=[],
    PROVE_ALIASES=["server-programmability"],
)

env.CppUnitTest(
    target="ticketholder_test",
    source=[
        "ticketholder_test.cpp",
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/db/auth/authmocks",
        "$BUILD_DIR/mongo/db/service_context_non_d",
        "$BUILD_DIR/mongo/db/service_context_test_fixture",
        "$BUILD_DIR/mongo/util/concurrency/ticketholder",
    ],
)

env.Benchmark(
    target="ticketholder_bm",
    source=[
        "ticketholder_bm.cpp",
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/db/admission/execution_admission_context",
        "$BUILD_DIR/mongo/db/concurrency/lock_manager",
        "$BUILD_DIR/mongo/db/service_context_non_d",
        "ticketholder",
    ],
    CONSOLIDATED_TARGET="second_half_bm",
)

env.Benchmark(
    target="lock_free_read_list_bm",
    source=[
        "lock_free_read_list_bm.cpp",
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/util/processinfo",
    ],
)

env.CppUnitTest(
    target="lock_free_read_list_test",
    source=[],
    LIBDEPS=[],
    PROVE_ALIASES=["server-programmability"],
)
